<script type="text/javascript">
function updateView(){
	val=$('#accounttype').val();
	if(val=='Receiveable Account' || val=='Payable Account'){
		$('#firstname').hide();
		$('#lastname').hide();
		$('#fulladdress').hide();
		$('#city').hide();
		$('#phonenumber').hide();
		$('#email').hide();
	}
	else{
		$('#firstname').show();
		$('#lastname').show();
		$('#fulladdress').show();
		$('#city').show();
		$('#phonenumber').show();
		$('#email').show();
	}
}
</script>


<?php if(!isset($act))  $act='saveAccount'; ?>

<div id="main">

  <div id="register">
  <h1><?=($act=='saveAccount')?"Create":"Update"?> Head Of Account</h1>  
  
  <div style="color:#903; text-align:left;"><?=$cmd?></div>
  
<form action="?page=accountHeads&sub=<?=$act?>" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?=$userInfo['accountID']?>"  />

  <div class="field_register">Account Type :
  <?php $acTyp = $userInfo['accountType']; ?>
    <SELECT NAME="accounttype" id="accounttype" class="register_field" onchange="updateView()">
        <OPTION VALUE="">Select</OPTION>
        <?php
		foreach($this->accountTypes as $accountType):
			if($userInfo['accountType']==$accountType) $sel="selected='selected'"; else $sel="";
		?>
        <OPTION VALUE="<?=$accountType?>" <?=$sel?>><?=$accountType?></OPTION>	
		<?php
		endforeach;
		?>
    </SELECT>
  </div>


  <div class="field_register">Account Name :
    <input name="accountname" type="text" class="register_field" id="accountName" value="<?=$userInfo['accountName']?>" />
  </div>
  
  <div class="field_register" id="firstname">First Name :
    <input name="firstname" type="text" class="register_field" value="<?=$userInfo['firstName']?>" />
  </div>
  
  <div class="field_register" id="lastname">Last Name :
    <input name="lastname" type="text" class="register_field" value="<?=$userInfo['lastName']?>" />
  </div>

  <div class="field_register" id="fulladdress" >Address :
    <input name="fulladdress" type="text" class="register_field" value="<?=$userInfo['fullAddress']?>" />
  </div>

  
  <div class="field_register" id="city">City :
    <input name="city" type="text" class="register_field" value="<?=$userInfo['city']?>" />
  </div>

  <div class="field_register" id="phonenumber">Phone Number :
    <input name="phonenumber" type="text" class="register_field" value="<?=$userInfo['phoneNumber']?>" />
  </div>

  <div class="field_register" id="email">EMail  :
   <input name="email" type="text" class="register_field" value="<?=$userInfo['email']?>" />
  </div>
  
   <div class="field_register"></div>
    <div class="field_register">
      <input type="submit" class="register_button" value="<?=($act=='saveAccount')?"Register":"Update"?>"  />
    </div>
</form>
  
  </div>

</div>